<?php

namespace App\Http\Requests\Admin\JobFair;

use App\Http\Requests\Request;

class CreateRequest extends Request{
    public function authorize(){
        return true;
    }

    public function rules(){
        return [
            'job_title' => 'required',
            'hold_time' => 'required',
            'hold_pm' => 'required',
            'hold_unit' => 'required',
            'hold_address' => 'required',
            'phone' => 'required',
            'exhibition' => 'required',
            'recruitment_type' => 'required',
            'longitude' => 'required|numeric',
            'latitude' => 'required|numeric',
            'to_attend' => 'required',
            'job_details' => 'required',
        ];
    }

    public function messages(){
        return [
            'job_title.required' => '招聘会名称不能为空',
            'hold_time.required' => '请选择举办时间',
            'hold_pm.required' => '举办点数不能为空',
            'hold_unit.required' => '举办单位不能为空',
            'hold_address.required' => '举办地点不能为空',
            'phone.required' => '联系电话不能为空',
            'exhibition.required' => '请选择订展',
            'recruitment_type.required' => '请选择招聘会类型',
            'longitude.required' => '坐标经度不能为空',
            'longitude.numeric' => '坐标经度必须是数字',
            'latitude.required' => '坐标纬度为空',
            'latitude.numeric' => '坐标纬度必须是数字',
            'to_attend.required' => '参与企业不能为空',
            'job_details.required' => '招聘会详情不能为空',
        ];
    }
}
